<template>
  <div class="announcements-container">
    <div v-for="(item, index) in announcements" :key="index" class="announcement-item">
      <div class="announcement-header">
        <i class="announcement-icon fas fa-bullhorn"></i>
        <h3 class="announcement-title">{{ item.title }}</h3>
        <span class="announcement-time">{{ item.time }}</span>
      </div>
      <div class="announcement-content">{{ item.content }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CommunityAnnouncements',
  data() {
    return {
      announcements: [
        {
          title: '系统维护通知',
          time: '2023-05-10 14:00',
          content: '系统将于5月15日凌晨2:00-4:00进行维护升级，期间服务将不可用。'
        },
        {
          title: '新功能上线',
          time: '2023-05-08 10:30',
          content: '社区新增私信功能，现在可以和其他用户发送私信了！'
        },
        {
          title: '社区规则更新',
          time: '2023-05-05 09:15',
          content: '请各位用户注意遵守新版社区规则，共同维护良好社区环境。'
        },
        {
          title: '活动预告',
          time: '2023-05-01 16:45',
          content: '下周将举办社区周年庆活动，参与有机会获得丰厚奖励！'
        },
        {
          title: '社区问答专区上线',
          time: '2023-04-28 11:20',
          content: '社区问答专区现已上线，欢迎大家在专区内提问和解答问题，共同学习成长。'
        },
        {
          title: '每周话题讨论',
          time: '2023-04-25 09:00',
          content: '本周话题：如何提高社区参与度？欢迎在话题区分享您的观点和建议。'
        },
      ]
    }
  }
}
</script>

<style scoped>
.announcements-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.announcement-item {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 8px;
  background-color: #f8f9fa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.announcement-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.announcement-icon {
  font-size: 20px;
  margin-right: 10px;
  color: rgba(236, 89, 89, 0.85);
}

.announcement-title {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  flex-grow: 1;
}

.announcement-time {
  font-size: 12px;
  color: #999;
}

.announcement-content {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}
</style>